from pyecharts.charts import Pie
from pyecharts import options
data=[('湖北',46790),("北京",52200),("上海",46799),("重庆",16500)]
pie=Pie()
pie.add(series_name="手机销量",data_pair=data,radius=["30%","70%"],rosetype="radius")
pie.set_series_opts(label_opts=options.LabelOpts(formatter="{b}:{d}%"))
pie.set_series_opts(label_opts=options.LabelOpts(formatter="{b}的占比:百分比{d}%"))
pie.render("饼图.html")